﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Processing001.Library.Interfaces;

namespace Processing001.Library
{
    public sealed class DefaultGenerator
    {
        private int n;
        private List<ComplexNumber> input = new List<ComplexNumber>();

        public DefaultGenerator(int n)
        {
            this.n = n;
        }

        public List<ComplexNumber> Generate()
        {
            List<ComplexNumber> result = new List<ComplexNumber>();
            GenerationFunction generation = new GenerationFunction(n);
            input.Clear();
            for (int iterator = 0; iterator < n; iterator++)
            {
                ComplexNumber number = generation.Execute(iterator);
                input.Add(new ComplexNumber((Math.PI * 2 / N) * iterator, 0));
                result.Add(number);
            }
            return result;
        }

        public int N
        {
            get { return n; }
            set { n = value; }
        }

        public List<ComplexNumber> Input
        {
            get { return input;}
            set { input = value; }
        }
    }
}
